<?php
   @$prompt=$_POST['prompt'];
   //echo $prompt;
$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://aixyx.com/suno/submit/music',
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'POST',
   CURLOPT_POSTFIELDS =>'
{
    "prompt": "'.$prompt.'",
    "tags": "emotional punk",
    "mv": "suno-v3.5",
    "title": "City Lights"
}
',
   CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer ',
      'User-Agent: Apifox/1.0.0 (https://apifox.com)',
      'Content-Type: application/json'
   ),
));
if(isset($_POST['prompt'])){
   $response = curl_exec($curl);

   curl_close($curl);
   $data = json_decode($response)->data;
   header("Location:suno2.php?d=$data");
   //echo $prompt;
}

?>
<h1><center>乐星</center></h1>
<form method='post' action='suno.php'>
   <center><label>输入歌词生成音乐</label><br></center>
   <center><input type="text" name='prompt' value=""></center>
   <center><input type="submit" value="提交"></center>
</form>